package com.roc.steelend.controller;


import com.roc.steelend.controller.vo.returnformat.ReturnMsgForTable;
import com.roc.steelend.pojo.BigType;
import com.roc.steelend.service.BigTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.Tag;
import org.apache.catalina.LifecycleState;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "产品大类功能接口")
@CrossOrigin
public class BigTypeController {

    @Autowired
    private BigTypeService bigTypeService;

    @GetMapping("/v1/big-type-show")
    @ApiOperation(value = "展示产品大类",notes = "可带一个产品小类id,也可以不带")
    public List<BigType>  selectBigTypeShow(@RequestParam(value = "smallTypeId",required = false)@ApiParam(value = "产品大类id",required = false)Integer smallTypeId){
        return bigTypeService.selectBigTypeShow(smallTypeId);
    }

    @GetMapping("/v1/big-type-show/detail")
    @ApiOperation(value = "展示产品大类（用户系统管理展示界面）")
    public ReturnMsgForTable selectBigTypeShowDetail(@RequestParam(value = "now",required = true)Integer now,
                                                     @RequestParam(value = "size",required = true)Integer size){
      return   bigTypeService.selectBigTypeShowDetail(now,size);
    }

}
